﻿using Newtonsoft.Json.Linq;

namespace NetEasyMusic.Lib.Recommend;

public class DjProgramRecommend : IRecommend
{
    public DjProgramRecommend()
    {
    }

    public DjProgramRecommend(JToken token)
    {
        Id = token["id"]?.ToObject<string>()!;
        Name = token["name"]?.ToObject<string>()!;
        Copywriter = token["copywriter"]?.ToObject<string>()!;
        PicUrl = token["picUrl"]?.ToObject<string>()!;
        DjNickname = token["program"]?["dj"]?["nickname"]?.ToObject<string>()!;
        DjSignature = token["program"]?["dj"]?["signature"]?.ToObject<string>()!;
        DjAvatarUrl = token["program"]?["dj"]?["avatarUrl"]?.ToObject<string>()!;
        Brand = token["program"]?["dj"]?["brand"]?.ToObject<string>()!;
        RadioId = token["program"]?["radio"]?["id"]?.ToObject<string>()!;
        RadioName = token["program"]?["radio"]?["name"]?.ToObject<string>()!;
        RadioPicUrl = token["program"]?["radio"]?["picUrl"]?.ToObject<string>()!;
        RadioDesc = token["program"]?["radio"]?["desc"]?.ToObject<string>()!;
        Channels = token["program"]?["channels"]?.ToObject<string[]>()!;
        Description = token["program"]?["description"]?.ToObject<string>()!;
    }

    public string Id { get; set; } = "";
    public string Name { get; set; } = "";
    public string Copywriter { get; set; } = "";
    public string DjNickname { get; set; } = "";
    public string DjSignature { get; set; } = "";
    public string DjAvatarUrl { get; set; } = "";
    public string Brand { get; set; } = "";
    public string RadioId { get; set; } = "";
    public string RadioName { get; set; } = "";
    public string RadioPicUrl { get; set; } = "";
    public string RadioDesc { get; set; } = "";
    public string[] Channels { get; set; } = [];
    public string Description { get; set; } = "";
    public string PicUrl { get; set; } = "";
}